<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
        <link href="./resources/primefaces-sunny/theme.css" rel="stylesheet" type="text/css" />
        <link href="./resources/primefaces-sunny/theme.css" rel="stylesheet" type="text/css" />
    </h:head>
    <h:body>
        <h:form>
            <p:growl id="growl" showDetail="true"/>
            <p:dataTable var="payment" value="#{admin.showInfor()}" paginator="true" rows="10" id="dt"  
                         selection="#{admin.pd}" selectionMode="single"  
                         rowSelectListener="#{admin.onRowSelect}"  
                         onRowSelectUpdate="results growl"  
                         onRowSelectComplete="accountDetailsDialog.show()"  
                         onRowUnselectUpdate="growl">  

                <f:facet name="header">  
                    Select a row to confirm account payment
                </f:facet>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Account ID: " />  
                    </f:facet>  
                    <h:outputText value="#{payment.paymentDetailsPK.accId}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Payment Date: " />  
                    </f:facet>  
                    <h:outputText value="#{payment.date}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Payment Name:  " />  
                    </f:facet>  
                    <h:outputText value="#{payment.paymentRate.paymentName}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Number of Date: " />  
                    </f:facet>  
                    <h:outputText value="#{payment.paymentRate.noDate}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Amount:  " />  
                    </f:facet>  
                    <h:outputText value="#{payment.amount}" />  
                </p:column>  

            </p:dataTable>
            <p:dialog header="Account Details" widgetVar="accountDetailsDialog" resizable="false"  
                      width="500" height="400" showEffect="explode" hideEffect="explode">  
                <div style="margin: 0 auto;text-align: left;border-style: none">
                    <h:panelGrid id="results" columns="4" cellpadding="10" cellspacing="10">  

                        <h:outputText value="Account ID: " />  
                        <h:outputText value="#{pd.paymentDetailsPK.accId}" />  

                        <h:outputText value="Payment Date: " />  
                        <h:outputText value="#{pd.date}" />  

                        <h:outputText value="Payment Name: " />  
                        <h:outputText value="#{pd.paymentRate.paymentName}" />  

                        <h:outputText value="Number of Date: " />  
                        <h:outputText value="#{pd.paymentRate.noDate}" />  

                        <h:outputText value="Amount: " />  
                        <h:outputText value="#{pd.amount}" />  
                        
                        <h:outputText value="" />  
                        <h:outputText value="" />  

                        <p:commandButton value="Active" actionListener="#{admin.confirmPayment}"/>

                    </h:panelGrid>  
                </div>
            </p:dialog>
        </h:form>
    </h:body>
</html>

